Custom Transform Objects
OpenDoc transform objects provide powerful transformational capabilities that are sufficient for most two-dimensional drawing. With transforms, you not only can position your graphical objects, but you also easily can scale, rotate, and skew them. You can combine the operations of frames' internal transforms with those of facets' external transforms to achieve sophisticated effects with a minimum of code.If you need to extend the power of transform objects even further, you can obtain the extra capability most efficiently by creating your own transform subclass. If you need to provide for nonlinear transformations (such as curved projections or sophisticated perspective effects), you can implement them as new methods and as overrides to the methods of
ODBaseTransform
, the superclass ofODTransform
.If you subclass
ODBaseTransform
, you must override at least the following methods:
Copy InvertPoint Reset CopyFrom InvertShape TransformPoint GetMatrix PostCompose TransformShape HasMatrix PreCompose WriteTo Invert ReadFrom Your
GetMatrix
method must throw the exceptionODErrTransformErr
. YourHasMatrix
method must returnkODFalse
. Other methods should perform tasks appropriate to your transform.For more information on matrices and transformations in two-dimensional drawing, you can consult any standard computer-graphics textbook, such as Computer Graphics Principles and Practice, 2nd ed., by Foley, vanDam, Feiner, and Hughes (Addison-Wesley, 1990).
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help